package com.alibaba.citrus.ots.b2b.trade.order.repository;

import com.alibaba.cz.base.tool.page.PageResult;
import com.alibaba.lattice2.epoch.sdk.model.Result;
import com.epoch.app.otsb2btradecenter.dto.OrderDetailDTO;
import com.epoch.app.otsb2btradecenter.dto.request.OrderLinePageQueryRequest;
import com.epoch.app.otsb2btradecenter.dto.request.QuerySaleOrderLine;
import com.epoch.app.otsb2btradecenter.dto.request.QuerySaleOrderLineRequest;
import com.epoch.app.otsb2btradecenter.dto.response.OrderLinePageQueryResponse;
import com.epoch.app.otsb2btradecenter.model.dto.AmountResponse;
import com.epoch.app.otsb2btradecenter.model.dto.PageQueryOrderLineESListRequest;
import com.epoch.app.otsb2btradecenter.model.dto.QueryOrderLineRequest;
import com.epoch.app.otsb2btradecenter.model.dto.SearchOrderLineListRequest;

import java.util.List;

public interface OrderLineQueryServiceRepository {

    /**
     * 分页查询销售子订单列表
     * @param request OrderLinePageQueryRequest
     * @return OrderLinePageQueryResponse
     */
    PageResult<List<OrderLinePageQueryResponse>> pageQuery(OrderLinePageQueryRequest request);

    /**
     * 根据ID查询销售子订单
     * @param id String
     * @return OrderLineSDO
     */
    OrderDetailDTO query(String id);

    List<QuerySaleOrderLine> queryScItemInfo(QuerySaleOrderLineRequest request);

    OrderDetailDTO queryOrderLine(QueryOrderLineRequest request);

    /**
     * ES分页查询销售明细列表
     * @param request PageQueryOrderLineESListRequest
     * @return OrderLinePageQueryResponse
     */
    Result<List<OrderLinePageQueryResponse>> pageQueryES(PageQueryOrderLineESListRequest request);

    /**
     * 根据渠道、部门。业务员查询销售订单的总数量
     * @param request
     * @return
     */
    Result<Long> countOrderNumber(PageQueryOrderLineESListRequest request);

    Result<AmountResponse> searchOrderLineList(SearchOrderLineListRequest request);
}
